package list;

public class List1 {
    public static void main(String[] args) {
        //-----链表的定义
//        Node head = new Node(3);
//        head.next = new Node(5);
//        head.next.next = new Node(8);
//        head.next.next.next = new Node(11);
//        head.next.next.next.next = new Node(13);

        Node head = new Node((int)(Math.random()*10)+1);
        head.next = new Node((int)(Math.random()*10)+1);
        head.next.next = new Node((int)(Math.random()*10)+1);
        head.next.next.next = new Node((int)(Math.random()*10)+1);
        head.next.next.next.next = new Node((int)(Math.random()*10)+1);

        Node n = head;
        while (n != null) {
            System.out.print(n.value+"\t");
            n = n.next;
        }
        System.out.println();
    }


    static class Node {
        private int value;
        private Node prev;
        private Node next;

        public Node(int value) {
            this.value = value;
        }
    }
}
